/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package MODEL;

import java.io.Serializable;
import java.math.BigDecimal;
import java.math.BigInteger;
import javax.persistence.*;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author ahmed
 */
@Entity
@Table(name = "PHOTOS")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Photos.findAll", query = "SELECT p FROM Photos p"),
    @NamedQuery(name = "Photos.findByIdPh", query = "SELECT p FROM Photos p WHERE p.idPh = :idPh"),
    @NamedQuery(name = "Photos.findByIdItem", query = "SELECT p FROM Photos p WHERE p.idItem = :idItem"),
    @NamedQuery(name = "Photos.findByNomPh", query = "SELECT p FROM Photos p WHERE p.nomPh = :nomPh"),
    @NamedQuery(name = "Photos.findByDescription", query = "SELECT p FROM Photos p WHERE p.description = :description"),
    @NamedQuery(name = "Photos.findByChemin", query = "SELECT p FROM Photos p WHERE p.chemin = :chemin")})
public class Photos implements Serializable {
    private static final long serialVersionUID = 1L;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Id
    @Basic(optional = false)
    @Column(name = "ID_PH")
    @GeneratedValue(strategy= GenerationType.AUTO)
    private BigDecimal idPh;
    @Basic(optional = false)
    @Column(name = "ID_ITEM")
    private BigInteger idItem;
    @Column(name = "NOM_PH")
    private String nomPh;
    @Column(name = "DESCRIPTION")
    private String description;
    @Column(name = "CHEMIN")
    private String chemin;

    public Photos() {
    }

    public Photos(BigDecimal idPh) {
        this.idPh = idPh;
    }

    public Photos(BigDecimal idPh, BigInteger idItem) {
        this.idPh = idPh;
        this.idItem = idItem;
    }

    public BigDecimal getIdPh() {
        return idPh;
    }

    public void setIdPh(BigDecimal idPh) {
        this.idPh = idPh;
    }

    public BigInteger getIdItem() {
        return idItem;
    }

    public void setIdItem(BigInteger idItem) {
        this.idItem = idItem;
    }

    public String getNomPh() {
        return nomPh;
    }

    public void setNomPh(String nomPh) {
        this.nomPh = nomPh;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getChemin() {
        return chemin;
    }

    public void setChemin(String chemin) {
        this.chemin = chemin;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idPh != null ? idPh.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Photos)) {
            return false;
        }
        Photos other = (Photos) object;
        if ((this.idPh == null && other.idPh != null) || (this.idPh != null && !this.idPh.equals(other.idPh))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "MODEL.Photos[ idPh=" + idPh + " ]";
    }
    
}
